package com.teach.service;

import com.alibaba.fastjson.JSON;
import com.teach.dto.AuthDto;
import com.teach.service.impl.AdminServiceImpl;
import org.junit.jupiter.api.Test;

public class AdminServiceTest {

  private AdminService adminService = new AdminServiceImpl();

  @Test
  public void login(){
    try{
      System.out.println("测试登录成功");
      AuthDto auth = adminService.login("admin", "123");
      System.out.println(JSON.toJSONString(auth,true));
    }catch (Exception ex){
      ex.printStackTrace();
    }


    try{
      System.out.println("测试用户名错误");
      AuthDto auth = adminService.login("admiadfasdfdsafn", "123");
      System.out.println(JSON.toJSONString(auth,true));
    }catch (Exception ex){
      ex.printStackTrace();
    }



    try{
      System.out.println("测试密码错误");
      AuthDto auth = adminService.login("admin", "12322323233232");
      System.out.println(JSON.toJSONString(auth,true));
    }catch (Exception ex){
      ex.printStackTrace();
    }
  }
}
